% conclusion: the number of false positive is 
% about max 0.3/32 (1%) and does not depend on the sample size
% on average 0.07+-0.26 electrode signif out of 32 (0.2% false positive)

chan   = 32;
trials = 6:2:100;
nrepet = 10;
restrials05 = zeros(nrepet,length(trials));
restrials01 = zeros(nrepet,length(trials));

for index = 1:length(trials)
    
    for repet = 1:nrepet
        [F df pval] = statcond({ rand(chan,7) rand(chan,7) }, 'mode', 'bootstrap', 'naccu', 1000, 'paired', 'off');
        [tmp pval2] = fdr(pval, 0.05);
        restrials05(repet,index) = sum(pval2);
        [tmp pval2] = fdr(pval, 0.01);
        restrials01(repet,index) = sum(pval2);
    end;
    
end;

figure; plot(trials, [ mean(restrials05,1); mean(restrials05,1) ]);
